package cn.taokuaidi.wangwang.client.mvc;

import cn.taokuaidi.wangwang.client.constants.AppEvents;

import com.extjs.gxt.ui.client.mvc.AppEvent;
import com.extjs.gxt.ui.client.mvc.Controller;

/**
 * 应用入口
 * 
 * @author 嘉陵江里捉鱼
 */
public class AppController extends Controller {

    private AppView appView;

    public AppController() {
        registerEventTypes(AppEvents.APP_INIT);
    }

    public void handleEvent(AppEvent event) {
        switch (event.type) {
            case AppEvents.APP_INIT:
                onInit(event);
                break;

        }
    }

    public void initialize() {
        appView = new AppView(this);
    }

    private void onInit(AppEvent event) {
        forwardToView(appView, event);

    }

}
